<template>
	<view>
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="backText"></block>
			<block slot="content">充值</block>
		</cu-custom>

		<view class="tc bg-white pt50" style="padding-bottom: 50rpx;">
			<view class="fs26 fw600">充值金额</view>
			<view class="fs66 ff">{{RechargeMoney}}<text class="fs26">元</text></view>
			<view class="fs26 text-muted" style="margin-top: -10rpx;" v-text="CompanyName"></view>
		</view>
		
		<view class="mt20">
			<label class="cu-form-group" v-for="(item,index) in items" @tap="activeIndex = index;">
				<view class="flex align-center pt20 pb20">
					<view>
						<image :src="imgurl+item.url" class="img74 mr30"></image>
					</view>
					<view style="text-align: left;">
						<view class="fs28 fw600">{{item.text}}</view>
						<view class="fs22 text-muted">{{item.num}}</view>
					</view>
				</view>
				<view v-show="activeIndex == index">
					<image :src="imgurl+'/icon_check.png'" class="img36"></image>
				</view>
			</label>
			
		</view>

		<view class="uni-btns text-bold bottom_btn">
			<button class="uni-btn-main radio uni-btn fs30" @tap="Recharge">确认支付</button>
		</view>

	</view>
</template>

<script>
	import base from 'utils/base.js';
	import tools from 'utils/tools.js';
	export default {
		data() {
			return {
				CompanyName:"",
				RechargeMoney:0,
				imgurl: this.$imgurl,
				activeIndex: 0,
				items: [{
						url: '/icon_pay01.png',
						text: '微信钱包',
						num: '',
						}
					// },
					// {
					// 	url: '/icon_pay02.png',
					// 	text: '支付宝',
					// 	num: '林晓然(18952891980)',
					// },
					// {
					// 	url: '/icon_pay03.png',
					// 	text: '中国银行',
					// 	num: '林晓然(3089)',
					// },

				],

			}
		},
		onLoad(options) {
		let	_self = this;
			_self.RechargeMoney = options.money;
					let globalData = getApp().globalData;
					_self.CompanyName=globalData.Customer.Name;
		
		},
		methods: {
			Recharge:function(){
				let currentPage = this;
				let globalData = getApp().globalData;
				let params = {
					type: 'POST',
					url: '/api/Recharge/Pay',
					data: {rechargeMoney:currentPage.RechargeMoney,MobileUIDomain:globalData.WebDomain,Body:"余额充值"},
					sCallback: function(response) {
						if (response.IsSuccess) {
							
							window.location=response.Data;
							
						} else {
							tools.showToast(response.msg);
							
						}
					}
				};
				base.request(params);
			}
		},


	}
</script>

<style lang="scss">
	.fs66 {
		font-size: 66rpx;
	}


	.img74 {
		width: 74rpx;
		height: 74rpx;
	}


	.img36 {
		width: 36rpx;
		height: 36rpx;
	}
</style>
